const api = require('../utils/request.js')

module.exports = {
  //查询设施
  facilityTypeList() {
    return api.request({
      url: '/wechat/facility/list',
      method: 'GET'
    })
  },
  //修改登录信息
  updateUserInfo: function (data) {
    return api.request({
      url: `/wechat/updateUserInfo`,
      method: 'POST',
      data: data
    })
  },
  // 获取营地详情
  campDetail(campId) {
    return api.request({
      url: `/wechat/camp/${campId}`,
      method: 'get'
    })
  },
  //营地服务设施
  serviceFacilities() {
    return api.request({
      url: "/wechat/facility/list",
    })
  },
  // 获取营地列表
  campList() {
    return api.request({
      url: '/wechat/camp/list',
      method: 'get'
    })
  },
  // 广告banner列表
  getBannerList() {
    return api.request({
      url: '/wechat/banner/list',
      method: 'GET'
    })
  },
  //获取服务设施信息
  getFacilityType() {
    return api.request({
      url: '/wechat/facilityType/list',
      method: 'GET'
    })
  },
  //修改状态
  updataFacility(data) {
    return api.request({
      url: '/wechat/facility',
      method: 'PUT',
      data
    })
  },
  //营地营位根据id获取 /wechat/campsite/list
  getCampCampsite(query) {
    return api.request({
      url: `/wechat/campsite/list`,
      method: 'GET',
      data: query
    })
  },
  // 活动列表
  getActivity(campid) {
    return api.request({
      url: `/wechat/activity/getInfoByCampId/${campid}`,
      method: 'GET'
    })
  },
  // 项目列表
  getProject(campid) {
    return api.request({
      url: `/wechat/project/getInfoByCampId/${campid}`,
      method: 'GET'
    })
  },
  //营地周边景点 /wechat/spots/getInfoByCampId/{campId}
  getSpots(campId) {
    return api.request({
      url: `/wechat/spots/getInfoByCampId/${campId}`,
      method: 'GET'
    })
  },
  // 收藏营地 与取消收藏
  collectCamp(data) {
    return api.request({
      url: '/wechat/collect',
      method: 'POST',
      data
    })
  },

  // 取消收藏营地
  removeCollectCamp(data) {
    return api.request({
      url: '/wechat/collect',
      method: 'POST',
      data
    })
  },
  // 首场列表
  collectList(userId) {
    return api.request({
      url: "/wechat/collect/list",
      method: "GET",
      data: {
        userId
      }
    })
  },
  //新增营地
  addCamp(data) {
    return api.request({
      url: '/wechat/camp',
      method: "POST",
      data
    })
  },
  // 上传服务设施
  addService(data) {
    return api.request({
      url: "/wechat/facility/add",
      method: "POST",
      data
    })
  },
}